home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / BEND.ZIP / FLOWER.POV < prev    next >
Encoding:
Text File  |  1997-06-13  |  1.6 KB  |  48 lines

  1. // OBJECT BENDER: WILTING FLOWER ANIMATION
  2. // ***************************************
  3. // This animation illustrates how the bend_start and bend_finish
  4. // options can be used to only bend part of an object.
  5.  
  6. // CAMERA AND LIGHTS
  7.    camera {location <2, 5, -10> look_at <2, -2, 0> angle 40}
  8.    light_source {<5, 30, -20> rgb 1.25}
  9.    light_source {<-5, -10, -20> rgb .5}
  10.  
  11. // CREATE FLOWER
  12.    #declare Petal = cylinder {<1, 0, -1>, <1, 0, 1>, 1
  13.       clipped_by {sphere {<0, 1, 0>, 1 scale <2, 1, 1>}}
  14.       pigment {onion
  15.          color_map {[0 rgb <1, 1, .3>] [.5 rgb 1]}
  16.          scale 3}
  17.       normal {wrinkles .2 scale <.5, 1, .2>}
  18.       finish {phong .1 phong_size 1}
  19.       scale <1, .6, .4>}
  20.  
  21.    #declare Flower = union {
  22.       #declare PetalRot = 0 #while (PetalRot < 360)
  23.          object {Petal rotate y * PetalRot}
  24.       #declare PetalRot = PetalRot + (360 / 5) #end
  25.       sphere {y, 1 scale <.3, .2, .3>
  26.          pigment {rgb <.9, .8, .4>}
  27.          normal {bumps 1 scale .02}}
  28.       sphere {y, 1 scale <.35, .35, .35> translate y * -.3}
  29.       cylinder {y * -10, 0, .07}
  30.       pigment {rgb <.3, .5, .2>}
  31.       finish {phong .1 phong_size 2}}
  32.  
  33. // BEND OPTIONS
  34.    #declare bend_object = Flower
  35.    #declare object_axis1 = y * -10
  36.    #declare object_axis2 = 0
  37.    #declare bend_smoothness = 40
  38.    #declare bend_direction = <1, 0, -1>
  39.    #declare MClock = pow(sin(clock * pi / 2), .5)
  40.    #declare bend_angle = MClock * 110
  41.  
  42. // ONLY BEND MIDDLE SECTION OF STEM
  43.    #declare bend_start = .9 - MClock * .4
  44.    #declare bend_finish = 1
  45.  
  46. // CREATE BENT OBJECT
  47.    #include "Bend.inc"
  48.